package com.zxm.sunshineaiary.util;

import android.view.View;
import android.widget.TextView;

/**
 * 用于设置字体颜色
 * 
 * @author Administrator
 * 
 */
public class ColorUtil {

	public static int color = 1;
	public static final int WHITE = 0;
	public static final int BLACK = 1;
	
	public static int[]  colors={0xFF6699,0x6699FF,0x66FF00};
	

	public static void setTextColor(TextView text) {
		switch (color) {
		case BLACK:
			text.setTextColor(android.graphics.Color.BLACK);
			break;
		case WHITE:
			text.setTextColor(android.graphics.Color.WHITE);
			break;
		}
	}

	/**
	 * 设置所有View背景的颜色
	 * 
	 * @param v
	 */
	public static void setViewColor(View v) {
		switch (color) {
		case BLACK:
			v.setBackgroundColor(android.graphics.Color.BLACK);
			break;
		case WHITE:
			v.setBackgroundColor(android.graphics.Color.WHITE);
			break;
		}
	}

	/**
	 * 设置所有View背景中文字的颜色
	 * 
	 * @param v
	 */
	public static void setViewColor(TextView v) {
		switch (color) {
		case WHITE:
			v.setTextColor(android.graphics.Color.BLACK);
			break;
		case BLACK:
			v.setTextColor(android.graphics.Color.WHITE);
			break;
		}
	}
	
	/**
	 * 获得文字颜色
	 * @return 颜色id
	 */
	public static int getTextColor(){
		switch (color) {
		case WHITE:
			return android.graphics.Color.WHITE;
		case BLACK:
			return android.graphics.Color.BLACK;
		}
		return 0;
	}

}
